//
//  PeopleProjectMode.m
//  Qihuo
//
//  Created by Vencoo-Mac1 on 13-12-16.
//  Copyright (c) 2013年 Vencoo. All rights reserved.
//

#import "PeopleProjectMode.h"

@implementation PeopleProjectMode
@synthesize mainTitle;
@synthesize remarks;
@synthesize selectButton1;
@synthesize selectButton2;
@synthesize stateFlag;
@synthesize checkTV;
- (id)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        // Initialization code
        self.frame = frame;
        self.backgroundColor = [UIColor whiteColor];
        
        stateFlag = YES;
        
        mainTitle = [[[UILabel alloc]initWithFrame:CGRectMake(118, 19, 300, 40)]autorelease];
        mainTitle.font = [UIFont boldSystemFontOfSize:25.0];
        mainTitle.text = @"防护密闭：";
        [self addSubview:mainTitle];
        
        UILabel * check1 = [[[UILabel alloc]initWithFrame:CGRectMake(118, 69, 200, 40)]autorelease];
        check1.font = [UIFont systemFontOfSize:25.0];
        check1.text = @"点动检测情况：";
        [self addSubview:check1];
        
        UILabel * zhengChang = [[[UILabel alloc]initWithFrame:CGRectMake(425, 69, 150, 40)]autorelease];
        zhengChang.font = [UIFont systemFontOfSize:25.0];
        zhengChang.text = @"正常";
        [self addSubview:zhengChang];
        
        selectButton1 = [UIButton buttonWithType:UIButtonTypeCustom];
        selectButton1.frame = CGRectMake(375, 70, 42, 42);
        [selectButton1 setBackgroundImage:[UIImage imageNamed:@"选中.png"] forState:UIControlStateNormal];
        selectButton1.tag = 1;
        [selectButton1 addTarget:self action:@selector(selectButtonPress:) forControlEvents:UIControlEventTouchUpInside];
        [self addSubview:selectButton1];
        
        UILabel * guZhang = [[[UILabel alloc]initWithFrame:CGRectMake(625, 69, 150, 40)]autorelease];
        guZhang.font = [UIFont systemFontOfSize:25.0];
        guZhang.text = @"故障";
        [self addSubview:guZhang];
        
        selectButton2 = [UIButton buttonWithType:UIButtonTypeCustom];
        selectButton2.frame = CGRectMake(580, 70, 42, 42);
        [selectButton2 setBackgroundImage:[UIImage imageNamed:@"未选中.png"] forState:UIControlStateNormal];
        selectButton2.tag = 0;
        [selectButton2 addTarget:self action:@selector(selectButtonPress:) forControlEvents:UIControlEventTouchUpInside];
        [self addSubview:selectButton2];
        
        UILabel * check2 = [[[UILabel alloc]initWithFrame:CGRectMake(118, 119, 150, 40)]autorelease];
        check2.font = [UIFont systemFontOfSize:25.0];
        check2.text = @"处理情况：";
        [self addSubview:check2];
        
        checkTV = [[[UITextView alloc]initWithFrame:CGRectMake(270, 119, 682, 154)]autorelease];
        checkTV.editable = YES;
        checkTV.scrollEnabled = YES;
        checkTV.layer.borderWidth = 1;
        checkTV.font = [UIFont systemFontOfSize:15.0];
//        checkTV.text = @"Lorem ipsum dolor sit er elit lamet, consectetaur cillium adipisicing pecu, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Nam liber te conscient to factor tum poen legum odioque civiuda.";
        [self addSubview:checkTV];
        
        UILabel * check3 = [[[UILabel alloc]initWithFrame:CGRectMake(118, 283, 150, 40)]autorelease];
        check3.font = [UIFont systemFontOfSize:25.0];
        check3.text = @"备注：";
        [self addSubview:check3];
        
        remarks = [[[UITextView alloc]initWithFrame:CGRectMake(270, 283, 682, 154)]autorelease];
        remarks.editable = YES;
        remarks.scrollEnabled = YES;
        remarks.layer.borderWidth = 1;
        remarks.font = [UIFont systemFontOfSize:15.0];
//        remarks.text = @"Lorem ipsum dolor sit er elit lamet, consectetaur cillium adipisicing pecu, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Nam liber te conscient to factor tum poen legum odioque civiuda.";
        [self addSubview:remarks];
    }
    return self;
}

- (void)selectButtonPress:(UIButton *)sender
{
    stateFlag = sender.tag;
    if (stateFlag) {
        [selectButton1 setBackgroundImage:[UIImage imageNamed:@"选中.png"] forState:UIControlStateNormal];
        [selectButton2 setBackgroundImage:[UIImage imageNamed:@"未选中.png"] forState:UIControlStateNormal];
    }
    else
    {
        [selectButton1 setBackgroundImage:[UIImage imageNamed:@"未选中.png"] forState:UIControlStateNormal];
        [selectButton2 setBackgroundImage:[UIImage imageNamed:@"选中.png"] forState:UIControlStateNormal];
    }
}

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect
{
    // Drawing code
}
*/

@end
